home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form AlarmForm
- BorderStyle = 1 '
- Caption = "
- ClientHeight = 780
- ClientLeft = 1665
- ClientTop = 2460
- ClientWidth = 3135
- Height = 1185
- Icon = "ALARM.frx":0000
- Left = 1605
- LinkTopic = "Form2"
- MaxButton = 0 'False
- ScaleHeight = 780
- ScaleWidth = 3135
- Top = 2115
- Width = 3255
- BeginProperty Font
- name = "
- size = 9
- bold = 0
- EndProperty
- Begin VB.Timer Timer1
- Interval = 500
- Left = 2640
- Top = 120
- End
- Begin VB.Label lblTime
- AutoSize = -1 'True
- BeginProperty Font
- name = "
- charset = 128
- weight = 400
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- Bold = 0
- EndProperty
- Height = 240
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 75
- End
- Attribute VB_Name = "AlarmForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim AlarmTime
- Const conMinimized = 1
- Private Sub Form_Click()
- AlarmTime = InputBox("
- B", "
- ", AlarmTime)
- If AlarmTime = "" Then Exit Sub
- If Not IsDate(AlarmTime) Then
- MsgBox "
- Else ' InputBox
- AlarmTime = CDate(AlarmTime) '
- date/time
- AlarmTime
- End If
- End Sub
- Private Sub Form_Load()
- AlarmTime = ""
- End Sub
- Private Sub Form_Resize()
- If WindowState = conMinimized Then '
- SetCaptionTime
- Else
- Caption = "
- End If
- End Sub
- Private Sub SetCaptionTime()
- Caption = Format(Time, "Medium Time") '
- "Medium Time"
- End Sub
- Private Sub Timer1_Timer()
- Static AlarmSounded As Integer
- If lblTime.Caption <> CStr(Time) Then
- '
- If Time >= AlarmTime And Not AlarmSounded Then
- Beep
- MsgBox "
- " & Time
- AlarmSounded = True
- ElseIf Time < AlarmTime Then
- AlarmSounded = False
- End If
- If WindowState = conMinimized Then
- '
- If Minute(CDate(Caption)) <> Minute(Time) Then SetCaptionTime
- Else
- '
- lblTime.Caption = Time
- End If
- End If
- End Sub
-